﻿@{
    ViewData["Title"] = "BackFillingView";
    Layout = null;
}
<link href="~/Content/bootstrap-theme.css" rel="stylesheet"/>
<link href="~/layer/skin/layer.css" rel="stylesheet"/>
<link href="~/layui/css/layui.css" rel="stylesheet"/>
<hr>
<h2 style="margin-left: 200px">基本信息</h2>
<hr>
<style>
    .td {
        margin-left: 20px;
    }
</style>
<div class="layui-card">
    <div class="layui-card-body">
        <table class="table table-bordered" style="">
            <tr>
                <td>
                    <label>姓 名：</label>
                </td>
                <td>
                    <span id="Name"></span>
                </td>
                <td>
                    <label>性 别：</label>
                </td>
                <td>
                    <span id="Sex"></span>
                </td>
            </tr>
            <tr>
                <td>
                    <label>手机号 ：</label>
                </td>
                <td>
                    <span id="Bphone"></span>
                </td>
                <td>
                    <label>院 校：</label>
                </td>
                <td>
                    <span id="Bacademy"></span>
                </td>
            </tr>
            <tr>
                <td>
                    <label >专 业：</label>
                </td>
                <td>
                    <span id="Bmajor"></span>
                </td>
                <td>
                    家庭住址
                </td>

                <td>
                    <div >
                        <span id="Bcolumn"></span>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <label>学 历：</label>
                </td>
                <td>
                    <span id="Education"></span>
                </td>
                <td>
                    <label>政治面貌：</label>
                </td>
                <td>
                    <span id="Bpolitics"></span>
                </td>
            </tr>
            <tr>
                <td>民 族：</td>
                <td>
                    <span id="Bnation"></span>
                </td>
                <td>籍 贯：</td>
                <td>
                    <span id="Bnative"></span>
                </td>
            </tr>
            <tr>
                <td>婚 姻：</td>
                <td>
                    <span id="MaritalStatus"></span>
                </td>
                <td>出生年月：</td>
                <td>
                    <span id="Bdate"></span>
                </td>

            </tr>
            <tr>
                <td>
                    <label >邮 箱：</label>
                </td>
                <td>
                    <label >
                        <span id="Bmailbox"></span>
                    </label>
                </td>
                <td>
                    <label >身份证号：</label>
                </td>
                <td>
                    <span id="Bnumber"></span>
                </td>
            </tr>
        </table>
    </div>
</div>

<hr class="layui-border-black">
<h2 style="margin-left: 200px"> 职业信息</h2>
<hr class="layui-border-black">
<table>
    <tr>
        <td> 部 门：</td>
        <td>
            <span id="Department"></span>
        </td>
        <td> 职 位：</td>
        <td>
            <span id="Position"></span>
        </td>
    </tr>
    <tr>
        <td> 员工类别：</td>
        <td>
            <span id="Category"></span>
        </td>
    </tr>
</table>

<div style="margin-left: 200px">
    <input type="button" class="layui-btn layui-btn-primary" value="返回" onclick="location.href='/PersonnelMatters/EmployeeRegistrationView'" />
</div>
<script src="~/Scripts/jquery-3.4.1.min.js"></script>
<script src="~/layer/layer.js"></script>
<script src="~/layui/layui.js"></script>
<script>
    var id = @ViewBag.id;
    $(function() {
        $.ajax({
            url: "/PersonnelMatters/GetBasicById?id=" + id,
            type: "get",
            success: function(obj) {
                console.log(obj);
                $("#Name").text(obj.name);
                $("#Sex").text(obj.sex);
                $("#Bphone").text(obj.bphone);
                $("#Bacademy").text(obj.bacademy);
                $("#Bmajor").text(obj.bmajor);
                $("#Bcolumn").text(obj.bcolumn);
                $("#Education").text(obj.education);
                $("#Bpolitics").text(obj.bpolitics);
                $("#Bnation").text(obj.bnation);
                $("#Bnative").text(obj.bnative);
                $("#MaritalStatus").text(obj.maritalStatus);
                $("#Bdate").text(renderTime(obj.bdate));
                $("#Bmailbox").text(obj.bmailbox);
                $("#Bnumber").text(obj.bnumber);
                $("#Department").text(obj.depName);
                $("#Position").text(obj.tName);
                $("#Category").text(obj.category);
            }
        });
    });


    function renderTime(date) {
        var dateee = new Date(date).toJSON();
        return new Date(+new Date(dateee) + 8 * 3600).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
    }
</script>